package 代理模式;

import 代理模式.impl.Boss;
import 代理模式.impl.Mishu;

public class Test {
    static void fun(Instance instance){
        instance.invite();
    }
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        Instance instance = Utils.getInstance(Boss.class, Instance.class, new BeforeAndAfter() {
            @Override
            public void befoer() {
                System.out.println("大家好");
            }

            @Override
            public void after() {
                System.out.println("再见");
            }
        });
        instance.invite();
//        Instance target=new Boss();
//        Instance proxy=new Mishu(target);
////        proxy.invite();
//        fun(proxy);
    }
}
